acme-common: cleanup acme start crontab migration
authorSatadru Pramanik, DO, MPH, MEng <[email protected]>
Wed, 3 Sep 2025 15:23:23 +0000 (11:23 -0400)
committerToke Høiland-Jørgensen <[email protected]>
Wed, 3 Sep 2025 21:25:08 +0000 (23:25 +0200)
The '/etc/init.d/acme start' crontab migration
should also delete the existing
'/etc/init.d/acme start' line.

Otherwise, on every sysupgrade that carries
forward existing configurations, a new
'0 0 * * * /etc/init.d/acme renew' line is
added to the crontab.

Furthermore, do not add an 'acme renew' crontab
line if it already exists.

Signed-off-by: Satadru Pramanik, DO, MPH, MEng <[email protected]>
net/acme-common/Makefile
net/acme-common/files/acme.uci-defaults

index e05b943c9a927b3a3332f7b62707d6ce701111af..f8f4898143e370a197965e4806a636a197015e1a 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=acme-common
-PKG_VERSION:=1.4.3
+PKG_VERSION:=1.4.4
 
 PKG_MAINTAINER:=Toke Høiland-Jørgensen <[email protected]>
 PKG_LICENSE:=GPL-3.0-only
index bf1bcb10fa5fe95a10d617c830fa0fdb6893bcb9..326f1e8c14444e670c7b9b0a9112b9fa56b84d42 100644 (file)
@@ -55,7 +55,8 @@ uci_commit
 
 # Migrate '/etc/init.d/acme start' to '/etc/init.d/acme renew'
 grep -q '/etc/init.d/acme start' /etc/crontabs/root 2>/dev/null && {
-       echo "0 0 * * * /etc/init.d/acme renew" >>/etc/crontabs/root
+       grep -q '/etc/init.d/acme' /etc/crontabs/root 2>/dev/null || echo "0 0 * * * /etc/init.d/acme renew" >>/etc/crontabs/root
+       sed '/0 0 * * * \/etc\/init.d\/acme start/d' /etc/crontabs/root
 }
 
 exit 0